<template>
  <div>

    <div
      class="main"
      v-for="(item,index) in arr"
      :key="index"
      @click="jump(item)"
      v-html="calred(item,val)"
    >
      <!-- <span>{{item}}</span>
      <van-divider></van-divider> -->
    </div>
  </div>
</template>

<script>
import { lightFn } from '@/utils/str'

// 导入局部组件必须在scrip里面导入,在App里面导入
export default {
  // 组件名称
  name: 'Exhibition',
  // 组件参数 接收来自父组件的数据
  props: {
    arr: {
      type: Array,
      required: true
    },
    val: {
      type: String
    }
  },
  // 接收局部注册的组件
  components: {},
  // 组件数据
  data () {
    return {}
  },
  created () {

  },
  methods: {
    // 关键字高亮
    calred (item, val) {
      return lightFn(item, val)
    },
    // 点击带参数跳转
    jump (val) {
      this.$router.push(`/search/${val}`)
    },
  }
}
</script>
<style lang='less' scoped>
.main {
  padding-top: 10px;
  padding-left: 10px;
  line-height: 100%;
  text-align: left;
  span {
    font-size: 16px;
  }
}
</style>
